<template>
	<div id="app">
		<Nav v-if="isShowTab" :data-state="$route.meta.keepAlive"></Nav>
		<!--路由视图-->
		<keep-alive>
			<router-view v-if="$route.meta.keepAlive" />
		</keep-alive>
		<router-view v-if="!$route.meta.keepAlive" />
	</div>
</template>

<script>
	import Nav from "@/components/nav/nav";
	export default {
		name: 'App',
		data() {
			return {};
		},
		watch: {},
		computed: {
			isShowTab() {
				return this.$route.meta.showNav;
			},
		},
		components: {
			Nav,
		},
		beforeRouteEnter(to, from, next) {
			next();
		},
		beforeRouteLeave(to, from, next) {
			next();
		},
		activated() {},
		deactivated() {},
		created() {},
		mounted() {},
		methods: {}
	}
</script>

<style lang='scss' scoped>
	@import '~@/assets/css/mixin';
	#app {
		width: 100%;
		min-height: 100%;
		overflow-x: hidden;
		background: $bgc;
	}
</style>